package permissions;

public class study {
    /*
    * 权限
    *   private:
    *   public
    *   default
    *   protected
    * */
    public String name;
    private int age;
    public void show(){
        System.out.println(name+age);
    }
    public void setAge(int age){
        if(age> 0 && age < 300){
            this.age = age;

        }else{
            System.out.println("年龄有误");
        }
    }
    public int getAge(){
        return this.age;
    }
}
